<?php


namespace App\Http\Controllers\Api\v1;

use App\common;
use App\Logic\InformationLogic;
use App\Logic\JointTenancyLogic;
use App\Models\News;
use Illuminate\Http\Request;
use Illuminate\Routing\Controller;

/**
 * 合租列表控制器
 * Class JointTenancyController
 * @package App\Http\Controllers\Api\v1
 * @name wjy
 */
class JointTenancyController extends Controller
{
    /**
     * 合租展示列表
     */
    public function JointTenancyList(){
        try {
            $Secondary=JointTenancyLogic::Secondary();
            return common::success(20000,$Secondary,'合租展示成功');
        }catch (\Exception $exception){
            return common::fail('',"",$exception->getMessage());
        }
    }
    /**
     * 合租详情
     */
    public function JointTenancyDetails(Request $request){
        try {
            $fangId=$request->get('id');
            $SecondaryMessage=JointTenancyLogic::SecondaryDetails($fangId);
            return common::success(20000,$SecondaryMessage,'合租详情展示成功');
        }catch (\Exception $exception){
            return common::fail('',"",$exception->getMessage());
        }
    }
    /**
     * 合租信息添加
     */
    public function InformationAdd(Request $request){
        try {
            $SecondaryAdd=InformationLogic::SecondaryAdd($request);
            return common::success(20000,$SecondaryAdd,'合租信息添加成功');
        }catch (\Exception $exception){
            return common::fail('',"",$exception->getMessage());
        }
    }
}
